import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';

/// 2022年更新  适配 flutter 3.0
/// Flutter IntrinsicHeight 自适应高度
class InstrinsicPage01 extends StatelessWidget {
  const InstrinsicPage01({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Flutter IntrinsicHeight 自适应高度"),
      ),
      body: buildRow(),
    );
  }

  buildRow() {
    return SizedBox(
      child: IntrinsicHeight(
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Container(
              width: 150,
              height: 100,
              color: Colors.teal,
            ),
            Container(
              width: 150,
              height: 200,
              color: Colors.red,
            )
          ],
        ),
      ),
    );
  }

}
